﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Reflection;

namespace HttpAuth.Configuration
{
    [ConfigurationCollection(typeof(HttpAuthUser), AddItemName="user", CollectionType=ConfigurationElementCollectionType.BasicMap)]
    public class HttpAuthUserCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new HttpAuthUser();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((HttpAuthUser)element).Name;
        }

        public new HttpAuthUser this[string name]
        {
            get { return (HttpAuthUser)this.BaseGet(name); }
        }

        public HttpAuthUser this[int index]
        {
            get { return (HttpAuthUser)this.BaseGet(index); }
        }
    }
}
